<?php
/**
 * Created by PhpStorm.
 * User: 戎大富
 * Date: 2017/3/28
 * Time: 11:05
 */
namespace app\common\model;
use think\Db;
class Heo extends \think\Model{
    protected $table='up_dog_heo';

    public function relData($pagesize){
        $model = self::instance();
        $list = $model->alias('u')
            ->order('heo_id desc')
            ->paginate($pagesize);
        return $list;
    }

    /**
     * @param $uid
     * @param string $field
     * @return array|false|\PDOStatement|string|\think\Model
     * 获取一条信息
     */
    public function getOne($where,$field='*'){
        $model = self::instance();
        $result = $model->where($where)->field($field)->find();
        return $result;
    }
    private static $instance;

    public static function instance()
    {
        if (!(self::$instance instanceof self)) {
            self::$instance = new self();
        }
        return self::$instance;
    }
}